﻿@{
    ViewBag.Title = "考试结果";
}

<div class="row">
    <div class="col-md-6 col-md-offset-3">
        <div class="panel panel-success">
            <div class="panel-heading">
                <h3 class="panel-title">考试已完成</h3>
            </div>
            <div class="panel-body text-center">
                <h2>您的考试成绩</h2>
                <div class="score-display">
                    <span class="score">@ViewBag.Score</span>
                    <span class="divider">/</span>
                    <span class="total">@ViewBag.TotalScore</span>
                </div>
                <p class="lead">
                    @{
                        var percentage = (int)Math.Round((double)ViewBag.Score / ViewBag.TotalScore * 100);
                        if (percentage >= 80)
                        {
                            <span class="text-success">优秀！</span>
                        }
                        else if (percentage >= 60)
                        {
                            <span class="text-primary">合格</span>
                        }
                        else
                        {
                            <span class="text-danger">不合格</span>
                        }
                    }
                </p>
                <a href="@Url.Action("Index", "Employee")" class="btn btn-primary">返回首页</a>
                <a href="@Url.Action("Results", "Employee")" class="btn btn-info">查看历史成绩</a>
            </div>
        </div>
    </div>
</div>

<style>
    .score-display {
        font-size: 3em;
        margin: 20px 0;
    }

    .score {
        color: #5cb85c;
        font-weight: bold;
    }

    .divider {
        color: #999;
    }

    .total {
        color: #333;
    }
</style>